<?php
if(!class_exists('XMapping', false)){
	require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'XMapping.php');
}
class XOneToOne extends XMapping{
	function result($value = null){
		if(is_null($this->foreignKey)){			
			return q($this->target())->find($value);
		}
		return q($this->target())
			->eq($this->foreignKey, $value)
			->find();
	}
}
?>